#pragma once

#include "Asura2DEngine/Asura2D.h"
#include <GL/glew.h>
#include "GLFW/glfw3.h"
#	pragma comment (lib, "glfw3.lib")
#	pragma comment (lib, "OpenGL32.lib")
#	pragma comment (lib, "glew32.lib")

using namespace av2d;

inline int Min(int a, int b)
{
	return a < b ? a : b;
}

static unsigned int seed = 0x13371337;

inline float random_float()
{
	float res;
	unsigned int tmp;

	seed *= 16807;

	tmp = seed ^ (seed >> 4) ^ (seed << 15);

	*((unsigned int *)&res) = (tmp >> 9) | 0x3F800000;

	return (res - 1.0f);
}

namespace vtarga
{
	unsigned char * load_targa(const char * filename, GLenum &format, int &width, int &height);
};

#define BUFFER_OFFSET(x)  ((const void*) (x))